export default function htmlEscape(text) {
    let reg = /[<>"&]/g;
    return text.replace(reg, (match, ...arg) => {
        switch (match) {
            case '<':
                return "&lt;";
            case ">":
                return "&gt;";
            case "&":
                return "&amp;";
            case "\"":
                return "&quot;";
            default:
                return "";
        }
    });
}
